import 'dart:convert';

import 'package:star_author/generated/json/base/json_field.dart';
import 'package:star_author/generated/json/user_info_entity.g.dart';

@JsonSerializable()
class UserInfoEntity {
  int? id;
  String? nickname;
  String? gender;
  String? intro;
  String? mobile;
  String? openid;
  @JSONField(name: "unhandled_treasures_count")
  int? unhandledTreasuresCount;
  @JSONField(name: "wechat_balance")
  dynamic wechatBalance;
  @JSONField(name: "is_specialist")
  bool? isSpecialist;
  @JSONField(name: "meta_info_id")
  int? metaInfoId;
  String? unionid;
  String? guarantee;
  @JSONField(name: "available_guarantee")
  String? availableGuarantee;
  @JSONField(name: "frozen_guarantee")
  int? frozenGuarantee;
  @JSONField(name: "refundable_guarantee")
  String? refundableGuarantee;
  String? balance;
  @JSONField(name: "real_name_authentication")
  bool? realNameAuthentication;
  @JSONField(name: "total_usable_amount")
  String? totalUsableAmount;
  @JSONField(name: "tender_by_guarantee_times")
  int? tenderByGuaranteeTimes;
  @JSONField(name: "total_winning_order_price")
  String? totalWinningOrderPrice;
  int? level;
  @JSONField(name: "app_openid")
  String? appOpenid;
  @JSONField(name: "created_at")
  String? createdAt;
  @JSONField(name: "adapay_settle_account_id")
  String? adapaySettleAccountId;
  @JSONField(name: "adapay_member_id")
  int? adapayMemberId;
  UserInfoSummary? summary;
  @JSONField(name: "is_vip")
  bool? isVip;
  @JSONField(name: "alipay_account")
  String? alipayAccount;
  @JSONField(name: "alipay_realname")
  String? alipayRealname;
  @JSONField(name: "current_month_performance")
  String? currentMonthPerformance;
  @JSONField(name: "is_bidder")
  bool? isBidder;
  @JSONField(name: "can_combine_ship")
  bool? canCombineShip;
  @JSONField(name: "first_time")
  bool? firstTime;
  String? avatar;
  @JSONField(name: "maintain_studios")
  List<UserInfoMaintainStudios>? maintainStudios;
  UserInfoApply? apply;
  dynamic bidder;
  UserInfoIdentification? identification;

  UserInfoEntity();

  factory UserInfoEntity.fromJson(Map<String, dynamic> json) =>
      $UserInfoEntityFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoSummary {
  @JSONField(name: "initial_backflows_count")
  int? initialBackflowsCount;
  @JSONField(name: "back_backflows_count")
  int? backBackflowsCount;
  @JSONField(name: "finished_backflows_count")
  int? finishedBackflowsCount;
  @JSONField(name: "evaluation_backflows_count")
  int? evaluationBackflowsCount;
  @JSONField(name: "sent_backflows_count")
  int? sentBackflowsCount;
  @JSONField(name: "onsale_backflows_count")
  int? onsaleBackflowsCount;
  @JSONField(name: "waitconfirm_backflows_count")
  int? waitconfirmBackflowsCount;
  @JSONField(name: "back_backflows_need_recycle_count")
  int? backBackflowsNeedRecycleCount;
  @JSONField(name: "initial_orders_count")
  int? initialOrdersCount;
  @JSONField(name: "paid_orders_count")
  int? paidOrdersCount;
  @JSONField(name: "shipping_orders_count")
  int? shippingOrdersCount;
  @JSONField(name: "from_bidder_need_paid_winning_orders_count")
  int? fromBidderNeedPaidWinningOrdersCount;
  @JSONField(name: "from_bidder_need_handle_winning_orders_count")
  int? fromBidderNeedHandleWinningOrdersCount;
  @JSONField(name: "from_bidder_offline_saling_winning_orders_count")
  int? fromBidderOfflineSalingWinningOrdersCount;
  @JSONField(name: "from_bidder_handled_backing_winning_orders_count")
  int? fromBidderHandledBackingWinningOrdersCount;
  @JSONField(name: "unhandled_after_sale_count")
  int? unhandledAfterSaleCount;
  @JSONField(name: "unread_finished_backflows_count")
  int? unreadFinishedBackflowsCount;
  @JSONField(name: "unread_unapproved_tenders_count")
  int? unreadUnapprovedTendersCount;
  @JSONField(name: "unread_approved_tenders_count")
  int? unreadApprovedTendersCount;
  @JSONField(name: "unread_change_treasures_count")
  int? unreadChangeTreasuresCount;
  @JSONField(name: "unread_notifications_count")
  int? unreadNotificationsCount;
  @JSONField(name: "unpaid_from_bidder_orders")
  int? unpaidFromBidderOrders;
  @JSONField(
      name: "valid_approved_and_paid_and_backflow_unhandled_tenders_count")
  int? validApprovedAndPaidAndBackflowUnhandledTendersCount;
  @JSONField(name: "valid_approved_and_need_paid_tenders_count")
  int? validApprovedAndNeedPaidTendersCount;
  @JSONField(name: "pending_tenders_count")
  int? pendingTendersCount;
  @JSONField(name: "stared_backflows_count")
  int? staredBackflowsCount;
  @JSONField(name: "tracks_count")
  int? tracksCount;

  UserInfoSummary();

  factory UserInfoSummary.fromJson(Map<String, dynamic> json) =>
      $UserInfoSummaryFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoSummaryToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoMaintainStudios {
  int? id;
  String? name;
  String? key;
  @JSONField(name: "begin_at")
  String? beginAt;
  @JSONField(name: "users_count")
  int? usersCount;
  @JSONField(name: "switch")
  bool? xSwitch;
  @JSONField(name: "view_users_count")
  int? viewUsersCount;
  dynamic anchoring;
  String? cover;
  String? avatar;
  @JSONField(name: "is_anchor")
  bool? isAnchor;

  UserInfoMaintainStudios();

  factory UserInfoMaintainStudios.fromJson(Map<String, dynamic> json) =>
      $UserInfoMaintainStudiosFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoMaintainStudiosToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoApply {
  int? id;
  String? realname;
  String? gender;
  @JSONField(name: "created_at")
  String? createdAt;
  @JSONField(name: "updated_at")
  String? updatedAt;
  String? region;
  String? mobile;
  String? introduction;
  List<dynamic>? skills;
  @JSONField(name: "accuracy_rate")
  String? accuracyRate;
  @JSONField(name: "likes_from_evaluations")
  int? likesFromEvaluations;
  @JSONField(name: "onsale_count")
  int? onsaleCount;
  @JSONField(name: "complete_count")
  int? completeCount;
  @JSONField(name: "experience_point")
  int? experiencePoint;
  String? photo;
  @JSONField(name: "photo_signed_id")
  String? photoSignedId;
  List<dynamic>? certificates;

  UserInfoApply();

  factory UserInfoApply.fromJson(Map<String, dynamic> json) =>
      $UserInfoApplyFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoApplyToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserInfoIdentification {
  int? id;
  String? name;
  @JSONField(name: "account_no")
  String? accountNo;
  @JSONField(name: "id_card")
  String? idCard;
  String? mobile;

  UserInfoIdentification();

  factory UserInfoIdentification.fromJson(Map<String, dynamic> json) =>
      $UserInfoIdentificationFromJson(json);

  Map<String, dynamic> toJson() => $UserInfoIdentificationToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
